home *** CD-ROM | disk | FTP | other *** search
- # include "BlobMgr.h"
-
-
-
- /* -------------------------------------------------------------------- */
- /* Blob Flag Manipulation Routines */
- /* */
- /* These routines operate only on the content of the blob state fields.*/
- /* They do NOT do any redrawing or change the display in any way. */
- /* */
- /* -------------------------------------------------------------------- */
-
-
- pascal void
- SetBlobFlags (BlobHandle b, short bitMask)
- {
- (**b).flags |= bitMask;
- }
-
-
- pascal void
- ClearBlobFlags (BlobHandle b, short bitMask)
- {
- (**b).flags &= ~bitMask; /* what's the operator here? */
- }
-
-
- /*
- * Test the function result to be sure it's equal to the bitMask
- * passed in, if exact match is required.
- */
-
- pascal short
- TestBlobFlags (BlobHandle b, short bitMask)
- {
- return ((**b).flags & bitMask);
- }
-
-
- pascal void
- EnableBlob (BlobHandle b)
- {
- SetBlobFlags (b, bEnableMask);
- }
-
-
- pascal void
- EnableBlobSet (BlobSetHandle bSet)
- {
- BlobLoopProc1 (&EnableBlob, bSet);
- }
-
-
- pascal void
- DisableBlob (BlobHandle b)
- {
- ClearBlobFlags (b, bEnableMask);
- }
-
-
- pascal void
- DisableBlobSet (BlobSetHandle bSet)
- {
- BlobLoopProc1 (&DisableBlob, bSet);
- }
-
-
- pascal short
- GetBDrawMode (BlobHandle b, short partCode)
- {
- short mask;
-
- mask = 0;
- switch (partCode)
- {
- case inDragBlob: mask = bDragModeMask; break;
- case inStatBlob: mask = bStatModeMask; break;
- }
- return (TestBlobFlags (b, mask) == mask ? dimDraw : normalDraw);
- }
-
-
- pascal void
- SetBDrawMode (BlobHandle b, short partCode, short mode)
- {
- short mask;
-
- switch (partCode)
- {
- case inFullBlob: mask = bDrawModeMask; break;
- case inDragBlob: mask = bDragModeMask; break;
- case inStatBlob: mask = bStatModeMask; break;
- }
- if (mode == dimDraw)
- SetBlobFlags (b, mask);
- else
- ClearBlobFlags (b, mask);
- }
-
-
- pascal short
- GetFzBDrawMode (BlobHandle b, short partCode)
- {
- short mask;
-
- mask = 0;
- switch (partCode)
- {
- case inDragBlob: mask = bDragModeMask; break;
- case inStatBlob: mask = bStatModeMask; break;
- }
- return (((**b).fzFlags & mask) == mask ? dimDraw : normalDraw);
- }
-
-
-
- pascal Boolean
- BlobDimmed (BlobHandle b, short partCode)
- {
- short bitMask;
-
- switch (partCode)
- {
- case inFullBlob: bitMask = bDrawModeMask; break;
- case inStatBlob: bitMask = bStatModeMask; break;
- case inDragBlob: bitMask = bDragModeMask; break;
- }
- return (TestBlobFlags (b, bitMask) == bitMask);
- }
-
-
- pascal Boolean
- BlobEnabled (BlobHandle b)
- {
- return (TestBlobFlags (b, bEnableMask) == bEnableMask);
- }
-
-
- pascal Boolean
- BlobFrozen (BlobHandle b)
- {
- return (TestBlobFlags (b, bFreezeMask) == bFreezeMask);
- }
-
-
- /*
- * Active = enabled, but not frozen.
- */
-
- pascal Boolean
- BlobActive (BlobHandle b)
- {
- return (TestBlobFlags (b, bEnableMask | bFreezeMask) == bEnableMask);
- }
-
-
- /*
- * Return true if the blob can be glued to another blob. This is true
- * if the blob is infinitely gluable or the current glue count is less
- * than the blob's maximum glue count.
- */
-
- pascal Boolean
- CanGlue (BlobHandle b)
- {
- short glueMax;
-
- glueMax = GetBGlueMax (b);
- return (glueMax == infiniteGlue || glueMax > (**b).glueCount);
- }
-
-
- /*
- * Return true if the blob is a picture blob, false if it's a
- * procedure blob
- */
-
- pascal Boolean
- PicBlob (BlobHandle b)
- {
- return (TestBlobFlags (b, bPicMask) == bPicMask);
- }